package engine.entities;

import java.awt.Point;

import engine.game.Tickable;
import engine.game.gfx.ColoredSprite;
import engine.game.gfx.Renderable;
import engine.game.gfx.Screen;
import engine.game.hud.StatBlockViewer.DispProp;
import engine.game.hud.StatBlockViewer.ViewerAction;
import engine.game.level.Level;

public abstract class Entity implements Tickable, Renderable {
    
    protected final int SCALE = 1;

    protected String name;
    protected Level level;
    protected Point coords;
    protected int xOff, yOff;

    public Entity(String name) {
        this.name = name;
    }
    
    @Override
    public abstract void tick();

    public abstract void render(Screen screen);
    
    public abstract ColoredSprite getSprite();
    
    public abstract boolean isViewable();
    
    public abstract DispProp[] getDisplayProperties();
    
    public abstract ViewerAction[] getViewerActions();
    
    public abstract ViewerAction getDefaultAction();

    public Level getLevel() {
        return level;
    }
    
    public void setLevel(Level level) {
        this.level = level;
    }
    
    public Point getCoords() {
        return coords;
    }

    public void setCoords(Point coords) {
        this.coords = coords;
    }
    
    public String getName() {
        return this.name;
    }

    protected void updateLocation(Point oldCoords, Point newCoords) {
        setCoords(newCoords);
        level.moveEntity(oldCoords, newCoords);
    }

    public int xOffset() {
        return xOff;
    }

    public int yOffset() {
        return yOff;
    }
}
